package com.cnn.function.stock.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.cnn.function.stock.mapper.StockInDetailsMapper;
import org.springframework.stereotype.Service;

import com.cnn.function.stock.pojo.StockInDetails;
import com.cnn.function.stock.pojo.StockInDetailsExample;
import com.cnn.function.stock.service.StockInDetailsService;

@Service
public class StockInDetailsServiceImpl implements StockInDetailsService {

    @Resource
    private StockInDetailsMapper stockInDetailsMapper;

    @Override
    public void addStockInDetails(StockInDetails stockInDetails) {
        stockInDetailsMapper.insert(stockInDetails);
    }

    @Override
    public void updateStockInDetails(StockInDetails stockInDetails) {
        stockInDetailsMapper.updateByPrimaryKeySelective(stockInDetails);
    }

    @Override
    public void deleteStockInDetails(Long id) {
        stockInDetailsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<StockInDetails> getStockInDetails() {
        return stockInDetailsMapper.selectByExample(new StockInDetailsExample());
    }

    @Override
    public StockInDetails getStockInDetailsById(Long id) {
        return stockInDetailsMapper.selectByPrimaryKey(id);
    }
}
